package com.geek.javase.ch15.work.banksync;
import java.util.concurrent.locks.ReentrantLock;
/*
 *@author wangpeng
 *2025/10/31 20:19
 *@description TODO
 */
/**
 * 存款线程类，用于执行存款操作
 * 实现Runnable接口，可作为线程任务执行
 */
public class DepositThread implements Runnable {
    // 创建ReentrantLock锁对象
    //private final ReentrantLock lock=new ReentrantLock();
    private Account account;

    public DepositThread(Account account) {
        this.account = account;
    }

    @Override
    public void run() {
        // 执行存款操作，存入5000元
        account.deposit(3000);
    }
}
